#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,e,x,y;
	scanf("%d.%d",&x,&y);
	a=x*100+y;
	scanf("%d.%d",&x,&y);
	b=x*100+y;
	scanf("%d.%d",&x,&y);
	c=x*100+y;
	scanf("%d.%d",&x,&y);
	d=x*100+y;
	scanf("%d.%d",&x,&y);
	e=x*100+y;
	int mi=min(a,min(b,min(c,d)));
	int ma=max(a,max(b,max(c,d)));
	int sum=a+b+c+d;
	if(e*3>=sum-mi) cout<<"infinite"<<endl;
	else if(e*3<sum-ma) cout<<"impossible"<<endl;
	else{
		int l=e*3-(sum-mi-ma);
		cout<<l/100<<".";
		int r=l%100;
		if(r<10) cout<<"0";
		cout<<r<<endl;
	}
	return 0;
}